﻿using Domain.NHibernate.Models;
using NHibernate;

namespace Web.Logic.Models.UnitOfWorkClasses
{
    public class GenericTransaction : IGenericTransaction
    {
        private readonly ITransaction transaction;

        public GenericTransaction(ITransaction transaction)
        {
            this.transaction = transaction;
        }
        
        public void Dispose()
        {
            transaction.Dispose();
        }

        public void Commit()
        {
            transaction.Commit();
        }

        public void Rollback()
        {
            transaction.Rollback();
        }
    }
}